package com.woniu.guoguo.controller;


import com.woniu.guoguo.common.Result;
import com.woniu.guoguo.model.Invite;
import com.woniu.guoguo.service.IInviteService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Richie
 * @since 2020-11-08
 */
@RestController
@Slf4j
@CrossOrigin("*")
public class InviteController {
    @Autowired
    private IInviteService iInviteService;
    @GetMapping("queryinvite")
    public Result queryinvit(HttpSession session){
        int userId = (Integer) session.getAttribute("userid");
        System.out.println(userId);
        List<Invite> queryinvite = iInviteService.queryinvite( userId);
        return Result.success(queryinvite);
    }
}

